﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Customer.ascx.cs" Inherits="ERP.Modules.Customer" %>
<script>
    function toggleBillingAddressFields(cb, checked) {
        var fieldset = cb.ownerCt;
        if (checked) {
            checked = false;
        } else {
            checked = true;
        }
        Ext.Array.forEach(fieldset.query('textfield'), function (field) {
            field.setDisabled(checked);
            if (!Ext.isIE6) {
                field.el.animate({ opacity: checked ? 0.3 : 1 });
            }
        });
        Ext.Array.forEach(fieldset.query('button'), function (field) {
            field.setDisabled(checked);
            if (!Ext.isIE6) {
                field.el.animate({ opacity: checked ? 0.3 : 1 });
            }
        });
    }
</script>
<%-------------------------------%>
<ext:Hidden ID="FormatTypeCustomer" runat="server" />
<ext:Panel runat="server" Layout="Fit" Border="False" ID="PanelCustomer">
    <Content>
        <%--------------GridCustomer-----------------%>
        <ext:GridPanel
            ID="grCustomer"
            Cls="grid-double"
            runat="server"
            EnableColumnMove="true"
            Border="False">
            <%-------------StoreCustomer-----------------%>
            <Store>
                <ext:Store
                    ID="StoreCustomer"
                    runat="server"
                    OnReadData="StoreCustomer_RefreshData"
                    PageSize="20">
                    <Model>
                        <ext:Model ID="ModelCustomer" runat="server" IDProperty="Customer_ID" GroupField="Customer_Type_Name">
                            <Fields>
                                <ext:ModelField Name="Customer_Alias" Type="String" />
                                <ext:ModelField Name="Customer_Type_Name" Type="String" />
                                <ext:ModelField Name="Customer_Shortcut" Type="Date" />
                                <ext:ModelField Name="Customer_Name" Type="String" />
                                <ext:ModelField Name="Enterprise_Name" Type="String" />
                                <ext:ModelField Name="Customer_Name_EN" Type="String" />
                                <ext:ModelField Name="Customer_Debt_Limit" Type="Float" />
                                <ext:ModelField Name="Customer_Name_Exchange" Type="String" />
                                <ext:ModelField Name="Customer_Address" Type="String" />
                                <ext:ModelField Name="Customer_Payment_Deadline" Type="Int" />
                                <ext:ModelField Name="Districts_Name" Type="String" />
                                <ext:ModelField Name="Province_Name" Type="String" />
                                <ext:ModelField Name="Customer_Establish" Type="Date" />
                                <ext:ModelField Name="Customer_Phone1" Type="String" />
                                <ext:ModelField Name="Customer_Phone2" Type="String" />
                                <ext:ModelField Name="Customer_Fax" Type="String" />
                                <ext:ModelField Name="Customer_Website" Type="String" />
                                <ext:ModelField Name="Sector_Name" Type="String" />
                                <ext:ModelField Name="Customer_Account_Number" Type="String" />
                                <ext:ModelField Name="Contact_Name" Type="String" />
                                <ext:ModelField Name="Job_Name" Type="String" />
                                <ext:ModelField Name="Contact_Phone" Type="String" />
                                <ext:ModelField Name="Contact_MobilePhone" Type="String" />
                                <ext:ModelField Name="Contact_Email" Type="String" />
                                <ext:ModelField Name="Bank_Name" Type="String" />
                                <ext:ModelField Name="Customer_Contract_FullName" Type="String" />
                                <ext:ModelField Name="Customer_Contract_Address" Type="String" />
                                <ext:ModelField Name="Customer_Contract_Tax_Code" Type="String" />
                                <ext:ModelField Name="Customer_Delivery_Address" Type="String" />
                                <ext:ModelField Name="Customer_Payment_Address" Type="String" />
                                <ext:ModelField Name="Customer_Note" Type="String" />
                                <ext:ModelField Name="Customer_Date_Add" Type="String" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:Store>
            </Store>
            <ColumnModel runat="server">
                <Columns>
                    <ext:RowNumbererColumn ID="RowNumbererColumn1" runat="server" Width="30" Align="Center" />
                    <ext:DateColumn runat="server" Text="Ngày nhập" Width="100" DataIndex="Customer_Date_Add" Format="dd-MM-yyyy" Align="Center"></ext:DateColumn>
                    <ext:Column ID="Column2" runat="server" Text="Mã khách hàng" Width="100" DataIndex="Customer_Alias"></ext:Column>
                    <ext:Column ID="Column3" runat="server" Text="Tên khách hàng" Width="150" DataIndex="Customer_Name"></ext:Column>
                    <ext:Column runat="server" Text="Loại khách hàng" Width="150" DataIndex="Customer_Type_Name"></ext:Column>
                    <ext:Column ID="Column7" runat="server" Text="Điện thoại" Width="90" DataIndex="Customer_Phone1"></ext:Column>
                    <ext:Column ID="Column8" runat="server" Text="Di động" Width="90" DataIndex="Customer_Phone2"></ext:Column>
                    <ext:Column ID="Column10" runat="server" Text="Địa chỉ" Width="100" DataIndex="Customer_Address"></ext:Column>
                    <ext:Column ID="Column5" runat="server" Text="Liên hệ" Width="100" DataIndex="Contact_Name"></ext:Column>
                    <ext:Column ID="Column6" runat="server" Text="Chức vụ" Width="100" DataIndex="Job_Name"></ext:Column>
                    <ext:Column ID="Column9" runat="server" Text="Loại" Width="100" DataIndex="Enterprise_Name"></ext:Column>
                    <ext:Column ID="Column11" runat="server" Text="Mã số thuế" Width="100" DataIndex="Customer_Contract_Tax_Code"></ext:Column>
                    <ext:Column ID="Column4" runat="server" Text="Ghi chú" Width="100" DataIndex="Customer_Note" Flex="1"></ext:Column>
                </Columns>
            </ColumnModel>
            <Features>
                <ext:Grouping
                    runat="server"
                    HideGroupedHeader="true"
                    GroupByText="Xem theo phân nhóm"
                    ShowGroupsText="Phân nhóm"
                    GroupHeaderTplString="{name} ({rows.length} danh mục con {[values.rows.length > 1 ? '' : '']})"
                    StartCollapsed="True" />
            </Features>
            <DirectEvents>
                <ItemDblClick OnEvent="CustomerDblClick">
                    <ExtraParams>
                        <ext:Parameter Name="Customer_ID" Value="record.data.Customer_ID" Mode="Raw" />
                    </ExtraParams>
                    <EventMask ShowMask="true" Msg="Đang tải..." />
                </ItemDblClick>
            </DirectEvents>
            <SelectionModel>
                <ext:CheckboxSelectionModel ID="CheckboxSelectionModelCustomer" runat="server" Mode="Multi">
                    <Listeners>
                       <SelectionChange Handler="
                            if (selected.length == 0) {
                                #{btnEdit}.disable();
                                #{btnDel}.disable();
                                #{btnExport}.disable();
                            } else {
                                #{btnEdit}.enable();
                                #{btnDel}.enable();
                                #{btnExport}.enable();
                            }" />
                   </Listeners>
                </ext:CheckboxSelectionModel>
            </SelectionModel>
            <DockedItems>
                <ext:Toolbar ID="ToolbarTopMain" runat="server" Dock="Top">
                    <Items>
                        <ext:Button ID="btnAddNew" runat="server" Text="Thêm mới" Icon="ApplicationAdd">
                            <DirectEvents>
                                <Click OnEvent="btnAddNew_Click">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                </Click>
                            </DirectEvents>
                        </ext:Button>

                        <ext:Button ID="btnEdit" runat="server" Text="Sửa" Icon="ApplicationEdit">
                            <DirectEvents>
                                <Click OnEvent="btnEdit_Click">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                </Click>
                            </DirectEvents>
                        </ext:Button>

                        <ext:Button ID="btnDel" runat="server" Text="Xoá" Icon="ApplicationDelete">
                            <DirectEvents>
                                <Click OnEvent="btnDel_Click">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                    <ExtraParams>
                                        <ext:Parameter Name="name" Value="btnDel"></ext:Parameter>
                                    </ExtraParams>
                                    <Confirmation ConfirmRequest="true"
                                        Title="Thông Báo" Message="Bạn có muốn xoá mẫu tin này không ?">
                                    </Confirmation>
                                </Click>
                            </DirectEvents>
                        </ext:Button>

                        <ext:Button ID="btnExport" runat="server" Text="Xuất tập tin" Icon="Printer">
                            <Menu>
                                <ext:Menu ID="MenuMain" runat="server">
                                    <Items>
                                        <ext:MenuItem ID="MenuItemExportXML" runat="server" Text="XML" Icon="PageCode">
                                            <Listeners>
                                                <Click Handler="submitValue(#{grCustomer}, #{FormatTypeCustomer}, 'xml');" />
                                            </Listeners>
                                        </ext:MenuItem>
                                    </Items>
                                </ext:Menu>
                            </Menu>
                        </ext:Button>

                    </Items>
                </ext:Toolbar>
                <ext:Toolbar ID="ToolbarPagging" runat="server" Dock="Bottom" AnchorHorizontal="100%">
                    <Items>
                        <ext:TriggerField ID="txtSearch" runat="server" Width="200" EnableKeyEvents="true" MarginSpec="0 8 0 0">
                            <Triggers>
                                <ext:FieldTrigger Icon="Search" />
                            </Triggers>
                            <DirectEvents>
                                <TriggerClick OnEvent="Search_Event"></TriggerClick>
                                <KeyPress OnEvent="Search_Event"></KeyPress>
                            </DirectEvents>
                        </ext:TriggerField>
                        <ext:SelectBox
                            ID="SelectBoxCustomerCustomerType"
                            runat="server"
                            Cls="x-select-box"
                            DisplayField="Customer_Type_Name"
                            ValueField="Customer_Type_ID"
                            MarginSpec="0 8 0 0"
                            EmptyText="Chọn loại  khách hàng">
                            <Store>
                                <ext:Store ID="StoreCustomerCustomerType" runat="server">
                                    <Model>
                                        <ext:Model runat="server">
                                            <Fields>
                                                <ext:ModelField Name="Customer_Type_Name" />
                                                <ext:ModelField Name="Customer_Type_ID" />
                                            </Fields>
                                        </ext:Model>
                                    </Model>
                                </ext:Store>
                            </Store>
                            <DirectEvents>
                                <Select OnEvent="SelectBoxCustomerCustomerType_Change">
                                    <EventMask ShowMask="true" Msg="Đang tải..."></EventMask>
                                </Select>
                            </DirectEvents>
                        </ext:SelectBox>
                        <ext:PagingToolbar ID="PagingToolbarCustomer" runat="server" StoreID="StoreCustomer" BeforePageText="Trang" AfterPageText="của {0}" LastText="Cuối" NextText="Kế tiếp" PrevText="Trở lại" FirstText="Đầu" RefreshText="Làm tươi" DisplayInfo="true" DisplayMsg="Trang {0} - {1} của {2}" />
                    </Items>
                </ext:Toolbar>
            </DockedItems>
        </ext:GridPanel>
    </Content>
</ext:Panel>
<ext:Panel runat="server">
    <Content>
        <%-----------WindowsCustomer-----------------%>
        <ext:Window ID="WindowsCustomer" runat="server"
            Title="Cập nhật khách hàng"
            DefaultAnchor="100%"
            Width="1102px"
            Hidden="true"
            AutoScroll="True"
            Maximizable="True"
            Maximized="True"
            Minimizable="True"
            AutoDataBind="False"
            Region="Center"
            Resizable="False"
            Modal="True"
            Constrain="true"
            HideMode="Offsets"
            Border="True"
            Padding="5"
            PaddingSummary="5px 5px 0"
            DefaultButton="btnSavePopUp">
            <Items>
                <ext:Toolbar ID="ToolbarCustomer" runat="server">
                    <Items>
                        <ext:Button runat="server" Text="Lưu lại" Icon="Disk" ID="btnSavePopUp">
                            <DirectEvents>
                                <Click OnEvent="btnSavePopUp_Click" Before="return #{FormPanelCustomer}.isValid();">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                        <ext:Button runat="server" Text="Huỷ bỏ" Icon="Decline" ID="btnCancelPopUp">
                            <DirectEvents>
                                <Click OnEvent="btnCancelPopUp_Click">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                        <ext:TextField ID="txtCustomer_ID" runat="server" FieldLabel="ID" LabelAlign="Right" Hidden="true" />
                    </Items>
                </ext:Toolbar>
                <ext:FormPanel ID="FormPanelCustomer" runat="server"
                    BodyPadding="10"
                    Frame="true"
                    DefaultAnchor="100%">
                    <Items>
                        <ext:FieldContainer ID="FieldContainer1"
                            runat="server"
                            AnchorHorizontal="100%"
                            Layout="HBoxLayout">
                            <Items>
                                <ext:TextField ID="txtCustomer_Alias" runat="server" FieldLabel="Mã khách hàng" AllowBlank="false" Width="250" Margins="0 20 0 0" />
                                <ext:FieldContainer runat="server" Layout="HBox">
                                    <Items>
                                        <ext:ComboBox ID="cbCustomer_Type"
                                            runat="server"
                                            QueryMode="Local"
                                            SelectOnFocus="true"
                                            ForceSelection="True"
                                            FieldLabel="Loại khách hàng"
                                            Width="222"
                                            AllowBlank="false"
                                            Margins="0 5 0 0"
                                            DisplayField="Customer_Type_Name"
                                            ValueField="Customer_Type_ID"
                                            EmptyText="Chọn loại khách hàng"
                                            ContextMenuID="cbCustomer_TypeContext">
                                            <Store>
                                                <ext:Store runat="server" ID="Customer_TypeStore" OnReadData="ReloadComboBox">
                                                    <Model>
                                                        <ext:Model ID="Customer_TypeModel" runat="server" IDProperty="Customer_Type_ID">
                                                            <Fields>
                                                                <ext:ModelField Name="Customer_Type_Name" Type="String" />
                                                            </Fields>
                                                        </ext:Model>
                                                    </Model>
                                                </ext:Store>
                                            </Store>
                                        </ext:ComboBox>
                                        <ext:Button runat="server" Icon="Add" MarginSpec="0 20 0 0">
                                            <Listeners>
                                                <Click Handler="#{WindowsCustomer_Type}.show();"></Click>
                                            </Listeners>
                                            <ToolTips>
                                                <ext:ToolTip runat="server" Html="Thêm mới loại khách hàng" />
                                            </ToolTips>
                                        </ext:Button>
                                    </Items>
                                </ext:FieldContainer>
                                <ext:FieldContainer runat="server" Layout="HBox">
                                    <Items>
                                        <ext:ComboBox ID="cbSector"
                                            runat="server"
                                            QueryMode="Local"
                                            SelectOnFocus="true"
                                            ForceSelection="True"
                                            FieldLabel="Ngành nghề"
                                            Width="222"
                                            Margins="0 5 0 0"
                                            AllowBlank="false"
                                            DisplayField="Sector_Name"
                                            ValueField="Sector_ID"
                                            EmptyText="Chọn ngành nghề"
                                            ContextMenuID="cbSectorContext">
                                            <Store>
                                                <ext:Store runat="server" ID="SectorStore" OnReadData="ReloadComboBox">
                                                    <Model>
                                                        <ext:Model ID="SectorModel" runat="server" IDProperty="Sector_ID">
                                                            <Fields>
                                                                <ext:ModelField Name="Sector_Name" Type="String" />
                                                            </Fields>
                                                        </ext:Model>
                                                    </Model>
                                                </ext:Store>
                                            </Store>
                                        </ext:ComboBox>
                                        <ext:Button runat="server" Icon="Add" MarginSpec="0 20 0 0">
                                            <Listeners>
                                                <Click Handler="#{WindowsSector}.show();"></Click>
                                            </Listeners>
                                            <ToolTips>
                                                <ext:ToolTip runat="server" Html="Thêm mới ngành nghề" />
                                            </ToolTips>
                                        </ext:Button>
                                    </Items>
                                </ext:FieldContainer>
                                <ext:FieldContainer runat="server" Layout="HBox">
                                    <Items>
                                        <ext:ComboBox ID="cbEnterprise"
                                            runat="server"
                                            QueryMode="Local"
                                            SelectOnFocus="true"
                                            ForceSelection="True"
                                            FieldLabel="Loại hình DN"
                                            Width="222"
                                            MarginSpec="0 5 0 0"
                                            AllowBlank="false"
                                            DisplayField="Enterprise_Name"
                                            ValueField="Enterprise_ID"
                                            EmptyText="Chọn loại hình doanh nghiệp"
                                            ContextMenuID="cbEnterpriseContext">
                                            <Store>
                                                <ext:Store runat="server" ID="EnterpriseStore" OnReadData="ReloadComboBox">
                                                    <Model>
                                                        <ext:Model ID="EnterpriseModel" runat="server" IDProperty="Enterprise_ID">
                                                            <Fields>
                                                                <ext:ModelField Name="Enterprise_Name" Type="String" />
                                                            </Fields>
                                                        </ext:Model>
                                                    </Model>
                                                </ext:Store>
                                            </Store>
                                        </ext:ComboBox>
                                        <ext:Button runat="server" Icon="Add">
                                            <Listeners>
                                                <Click Handler="#{WindowsEnterprise}.show();"></Click>
                                            </Listeners>
                                            <ToolTips>
                                                <ext:ToolTip runat="server" Html="Thêm mới loại hình doanh nghiệp" />
                                            </ToolTips>
                                        </ext:Button>
                                    </Items>
                                </ext:FieldContainer>
                            </Items>
                        </ext:FieldContainer>
                        <ext:FieldContainer ID="FieldContainer2"
                            runat="server"
                            AnchorHorizontal="100%"
                            Layout="HBoxLayout">
                            <Items>
                                <ext:TextField ID="txtCustomer_Name" runat="server" FieldLabel="Tên khách hàng" Width="250" AllowBlank="false" Margins="0 20 0 0" />
                                <ext:TextField ID="txtCustomer_Shortcut" runat="server" FieldLabel="Tên viết tắt" Width="250" Margins="0 20 0 0" />
                                <ext:TextField ID="txtCustomer_Name_Exchange" runat="server" FieldLabel="Tên giao dịch" Width="250" AllowBlank="false" Margins="0 20 0 0" />
                                <ext:TextField ID="txtCustomer_Name_EN" runat="server" FieldLabel="Tên tiếng anh" Width="250" AllowBlank="false" />
                            </Items>
                        </ext:FieldContainer>
                        <ext:FieldContainer ID="FieldContainer8"
                            runat="server"
                            AnchorHorizontal="100%"
                            Layout="HBoxLayout">
                            <Items>
                                <ext:TextField ID="txtCustomer_Address" runat="server" FieldLabel="Địa chỉ giao dịch" Width="520" AllowBlank="false" Margins="0 20 0 0" />
                                <ext:NumberField ID="txtCustomer_Debt_Limit" runat="server" FieldLabel="Hạn mức nợ" Width="250" Margins="0 20 0 0" />
                                <ext:NumberField ID="txtCustomer_Payment_Deadline" runat="server" FieldLabel="Hạn thanh toán" Width="250" EmptyText="Ngày" />
                            </Items>
                        </ext:FieldContainer>
                        <ext:FieldContainer ID="FieldContainer3"
                            runat="server"
                            AnchorHorizontal="100%"
                            Layout="HBoxLayout">
                            <Items>
                                <ext:FieldContainer runat="server" Layout="HBox">
                                    <Items>
                                        <ext:ComboBox runat="server"
                                            ID="cbProvince"
                                            QueryMode="Local"
                                            SelectOnFocus="true"
                                            ForceSelection="True"
                                            FieldLabel="Tỉnh" Width="222"
                                            DisplayField="Province_Name"
                                            ValueField="Province_Id"
                                            EmptyText="Chọn tỉnh"
                                            Margins="0 5 0 0"
                                            ContextMenuID="cbProvinceContext">
                                            <Listeners>
                                                <Select Handler="#{cbDistricts}.clearValue(); #{DistrictsStore}.reload();"></Select>
                                            </Listeners>
                                            <Store>
                                                <ext:Store runat="server" ID="ProvinceStore" AutoLoad="true" OnReadData="ReloadComboBox">
                                                    <Model>
                                                        <ext:Model ID="ProvinceModel" runat="server" IDProperty="Province_Id">
                                                            <Fields>
                                                                <ext:ModelField Name="Province_Alias" Type="String" />
                                                                <ext:ModelField Name="Province_Name" Type="String" />
                                                            </Fields>
                                                        </ext:Model>
                                                    </Model>
                                                </ext:Store>
                                            </Store>
                                        </ext:ComboBox>
                                        <ext:Button runat="server" Icon="Add" MarginSpec="0 20 0 0">
                                            <Listeners>
                                                <Click Handler="#{WindowsProvince}.show();"></Click>
                                            </Listeners>
                                            <ToolTips>
                                                <ext:ToolTip runat="server" Html="Thêm mới tỉnh" />
                                            </ToolTips>
                                        </ext:Button>
                                    </Items>
                                </ext:FieldContainer>
                                <ext:FieldContainer runat="server" Layout="HBox">
                                    <Items>
                                        <ext:ComboBox runat="server"
                                            ID="cbDistricts"
                                            QueryMode="Local"
                                            SelectOnFocus="True"
                                            ForceSelection="True"
                                            FieldLabel="Quận huyện" Width="222" AllowBlank="false"
                                            DisplayField="Districts_Name"
                                            ValueField="Districts_Id"
                                            EmptyText="Chọn quận huyện"
                                            Margins="0 5 0 0"
                                            ContextMenuID="cbDistrictsContext">
                                            <Store>
                                                <ext:Store runat="server" ID="DistrictsStore" AutoLoad="true" OnReadData="ProvinceSelectIndex_Change">
                                                    <Model>
                                                        <ext:Model ID="DistrictsModel" runat="server" IDProperty="Districts_Id">
                                                            <Fields>
                                                                <ext:ModelField Name="Districts_Name" Type="String" />
                                                            </Fields>
                                                        </ext:Model>
                                                    </Model>
                                                </ext:Store>
                                            </Store>
                                            <DirectEvents>
                                                <Select OnEvent="DistrictSelectIndex_Change"></Select>
                                            </DirectEvents>
                                        </ext:ComboBox>
                                        <ext:Button runat="server" Icon="Add" MarginSpec="0 20 0 0">
                                            <Listeners>
                                                <Click Handler="#{WindowsDistricts}.show();"></Click>
                                            </Listeners>
                                            <ToolTips>
                                                <ext:ToolTip runat="server" Html="Thêm mới quận huyện" />
                                            </ToolTips>
                                        </ext:Button>
                                    </Items>
                                </ext:FieldContainer>
                                <ext:TextField ID="txtCustomer_Website" runat="server" FieldLabel="Website" Width="250" Margins="0 20 0 0" />
                                <ext:DateField ID="txtCustomer_Establish" runat="server" FieldLabel="Ngày thành lập" Width="250" AllowBlank="false" />
                            </Items>
                        </ext:FieldContainer>
                        <ext:FieldContainer ID="FieldContainer4"
                            runat="server"
                            AnchorHorizontal="100%"
                            Layout="HBoxLayout">
                            <Items>
                                <ext:TextField ID="txtCustomer_Phone1" runat="server" FieldLabel="Điện thoại" Width="250" Margins="0 20 0 0" />
                                <ext:TextField ID="txtCustomer_Phone2" runat="server" FieldLabel="Di động" Width="250" Margins="0 20 0 0" />
                                <ext:FieldContainer runat="server" Layout="HBox">
                                    <Items>
                                        <ext:Hidden runat="server" ID="txtCustomer_Contact_ID"></ext:Hidden>
                                        <ext:TextField runat="server" AllowBlank="False" ID="txtCustomer_Contact_Name" FieldLabel="Người liên hệ" Width="222" MarginSpec="0 5 0 0" ReadOnly="True" FieldCls="readonly"></ext:TextField>
                                        <ext:Button runat="server" ID="btnAddCusWindows" ToolTip="Thêm người liên hệ" Text="...">
                                            <DirectEvents>
                                                <Click OnEvent="btnCustomer_Contact_Click">
                                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                                </Click>
                                            </DirectEvents>
                                        </ext:Button>
                                    </Items>
                                </ext:FieldContainer>
                            </Items>
                        </ext:FieldContainer>
                        <ext:FieldContainer ID="FieldContainer5"
                            runat="server"
                            AnchorHorizontal="100%"
                            Layout="HBoxLayout">
                            <Items>
                                <ext:TextField ID="txtCustomer_Fax" runat="server" FieldLabel="Fax" Width="250" Margins="0 20 0 0" />
                                <ext:FieldContainer runat="server" Layout="HBox">
                                    <Items>
                                        <ext:ComboBox ID="cbBank"
                                            runat="server"
                                            QueryMode="Local"
                                            SelectOnFocus="true"
                                            ForceSelection="True"
                                            FieldLabel="Ngân hàng"
                                            Width="222" Margins="0 5 0 0"
                                            AllowBlank="false"
                                            DisplayField="Bank_Name"
                                            ValueField="Bank_Id"
                                            EmptyText="Chọn ngân hàng"
                                            ContextMenuID="cbBankContext">
                                            <Store>
                                                <ext:Store runat="server" ID="BankStore" OnReadData="ReloadComboBox">
                                                    <Model>
                                                        <ext:Model ID="BankModel" runat="server" IDProperty="Bank_Id">
                                                            <Fields>
                                                                <ext:ModelField Name="Bank_Name" Type="String" />
                                                            </Fields>
                                                        </ext:Model>
                                                    </Model>
                                                </ext:Store>
                                            </Store>
                                        </ext:ComboBox>
                                        <ext:Button runat="server" Icon="Add" MarginSpec="0 20 0 0">
                                            <Listeners>
                                                <Click Handler="#{WindowsBank}.show();"></Click>
                                            </Listeners>
                                            <ToolTips>
                                                <ext:ToolTip ID="ToolTip1" runat="server" Html="Thêm mới ngân hàng" />
                                            </ToolTips>
                                        </ext:Button>
                                    </Items>
                                </ext:FieldContainer>
                                <ext:TextField ID="txtCustomer_Contact_Job" runat="server" FieldLabel="Chức vụ" Width="250" ReadOnly="True" FieldCls="readonly" Margins="0 20 0 0" />
                                <ext:TextField ID="txtCustomer_Contact_Email" runat="server" FieldLabel="Email" Width="250" ReadOnly="True" FieldCls="readonly" />
                            </Items>
                        </ext:FieldContainer>
                        <ext:FieldContainer ID="FieldContainer10"
                            runat="server"
                            AnchorHorizontal="100%"
                            Layout="HBoxLayout">
                            <Items>
                                <ext:TextField ID="txtCustomer_Account_Number" runat="server" FieldLabel="Số tài khoản" Margins="0 20 0 0" Width="520" />
                                <ext:TextField ID="txtCustomer_Contact_Phone" runat="server" FieldLabel="Điện thoại" Width="250" Margins="0 20 0 0" ReadOnly="True" FieldCls="readonly" />
                                <ext:TextField ID="txtCustomer_Contact_MobilePhone" runat="server" FieldLabel="Di động" Width="250" ReadOnly="True" FieldCls="readonly" />
                            </Items>
                        </ext:FieldContainer>
                        <ext:FieldSet ID="FieldSet1"
                            runat="server"
                            Title="Thông tin hóa đơn tài chính"
                            Collapsible="true"
                            DefaultAnchor="100%"
                            PaddingSpec="0 10 0 10">
                            <Items>
                                <ext:FieldContainer runat="server" Layout="HBox">
                                    <Items>
                                        <ext:Checkbox runat="server" ID="ckContract" MarginSpec="0 4 0 0" Handler="toggleBillingAddressFields"></ext:Checkbox>
                                        <ext:FieldContainer runat="server">
                                            <Items>
                                                <ext:FieldContainer ID="FieldContainer11"
                                                    runat="server"
                                                    AnchorHorizontal="100%"
                                                    Layout="HBoxLayout">
                                                    <Items>
                                                        <ext:TextField ID="txtCustomer_Contract_FullName" runat="server" FieldLabel="Tên đầy đủ" Width="500" MarginSpec="0 20 0 0" Disabled="True" />
                                                        <ext:Hidden runat="server" ID="txtCustomer_Contract_Contact_ID"></ext:Hidden>
                                                        <ext:TextField runat="server" ID="txtCustomer_Contract_Contact_Name" FieldLabel="Người ký HĐ" Width="212" MarginSpec="0 5 0 0" ReadOnly="True" FieldCls="readonly" Disabled="True"></ext:TextField>
                                                        <ext:Button runat="server" ID="Button1" ToolTip="Thêm người liên hệ" Text="..." Disabled="True">
                                                            <DirectEvents>
                                                                <Click OnEvent="btnCustomer_Contract_Click">
                                                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                                                </Click>
                                                            </DirectEvents>
                                                        </ext:Button>
                                                    </Items>
                                                </ext:FieldContainer>
                                                <ext:FieldContainer ID="FieldContainer14"
                                                    runat="server"
                                                    AnchorHorizontal="100%"
                                                    Layout="HBoxLayout">
                                                    <Items>
                                                        <ext:TextField ID="txtCustomer_Contract_Address" runat="server" FieldLabel="Địa chỉ" Width="240" MarginSpec="0 20 0 0" Disabled="True" />
                                                        <ext:TextField ID="txtCustomer_Contract_Tax_Code" runat="server" FieldLabel="Mã số thuế" Width="240" MarginSpec="0 20 0 0" Disabled="True" />
                                                        <ext:TextField ID="txtCustomer_Contract_Contact_Job" runat="server" FieldLabel="Chức vụ" Width="240" MarginSpec="0 20 0 0" ReadOnly="True" FieldCls="readonly" Disabled="True" />
                                                        <ext:TextField ID="txtCustomer_Contract_Contact_Email" runat="server" FieldLabel="Email" Width="240" ReadOnly="True" FieldCls="readonly" Disabled="True" />
                                                    </Items>
                                                </ext:FieldContainer>
                                                <ext:FieldContainer ID="FieldContainer15"
                                                    runat="server"
                                                    AnchorHorizontal="100%"
                                                    Layout="HBoxLayout">
                                                    <Items>
                                                        <ext:FieldContainer runat="server" Layout="HBox">
                                                            <Items>
                                                                <ext:ComboBox runat="server"
                                                                    ID="cbProvince1"
                                                                    QueryMode="Local"
                                                                    SelectOnFocus="true"
                                                                    ForceSelection="True"
                                                                    FieldLabel="Tỉnh" Width="212"
                                                                    DisplayField="Province_Name"
                                                                    ValueField="Province_Id"
                                                                    EmptyText="Chọn tỉnh"
                                                                    Margins="0 5 0 0"
                                                                    StoreID="ProvinceStore"
                                                                    ContextMenuID="cbProvince1Context"
                                                                    Disabled="True">
                                                                    <Listeners>
                                                                        <Select Handler="#{cbDistricts1}.clearValue(); #{Districts1Store}.reload();"></Select>
                                                                    </Listeners>
                                                                </ext:ComboBox>
                                                                <ext:Button runat="server" Icon="Add" MarginSpec="0 20 0 0" Disabled="True">
                                                                    <Listeners>
                                                                        <Click Handler="#{WindowsProvince}.show();"></Click>
                                                                    </Listeners>
                                                                    <ToolTips>
                                                                        <ext:ToolTip runat="server" Html="Thêm mới tỉnh" />
                                                                    </ToolTips>
                                                                </ext:Button>
                                                            </Items>
                                                        </ext:FieldContainer>
                                                        <ext:FieldContainer runat="server" Layout="HBox">
                                                            <Items>
                                                                <ext:ComboBox runat="server"
                                                                    ID="cbDistricts1"
                                                                    QueryMode="Local"
                                                                    SelectOnFocus="true"
                                                                    ForceSelection="True"
                                                                    FieldLabel="Quận huyện" Width="212" AllowBlank="false"
                                                                    DisplayField="Districts_Name"
                                                                    ValueField="Districts_Id"
                                                                    EmptyText="Chọn quận huyện"
                                                                    ReadOnly="True"
                                                                    Margins="0 5 0 0"
                                                                    ContextMenuID="cbDistricts1Context"
                                                                    Disabled="True">
                                                                    <Store>
                                                                        <ext:Store runat="server" ID="Districts1Store" AutoLoad="true" OnReadData="Province1SelectIndex_Change">
                                                                            <Model>
                                                                                <ext:Model ID="Districts1Model" runat="server" IDProperty="Districts_Id">
                                                                                    <Fields>
                                                                                        <ext:ModelField Name="Districts_Name" Type="String" />
                                                                                    </Fields>
                                                                                </ext:Model>
                                                                            </Model>
                                                                        </ext:Store>
                                                                    </Store>
                                                                </ext:ComboBox>
                                                                <ext:Button runat="server" Icon="Add" MarginSpec="0 20 0 0" Disabled="True">
                                                                    <Listeners>
                                                                        <Click Handler="#{WindowsDistricts}.show();"></Click>
                                                                    </Listeners>
                                                                    <ToolTips>
                                                                        <ext:ToolTip runat="server" Html="Thêm mới quận huyện" />
                                                                    </ToolTips>
                                                                </ext:Button>
                                                            </Items>
                                                        </ext:FieldContainer>
                                                        <ext:TextField ID="txtCustomer_Contract_Contact_Phone" runat="server" FieldLabel="Điện thoại" Width="240" ReadOnly="True" FieldCls="readonly" MarginSpec="0 20 0 0" Disabled="True" />
                                                        <ext:TextField ID="txtCustomer_Contract_Contact_MobilePhone" runat="server" FieldLabel="Di động" Width="240" ReadOnly="True" FieldCls="readonly" Disabled="True" />
                                                    </Items>
                                                </ext:FieldContainer>
                                            </Items>
                                        </ext:FieldContainer>
                                    </Items>
                                </ext:FieldContainer>
                            </Items>
                        </ext:FieldSet>
                        <ext:FieldSet ID="FieldSet2"
                            runat="server"
                            Title="Thông tin giao nhận"
                            Collapsible="true"
                            DefaultAnchor="100%"
                            PaddingSpec="0 10 0 10">
                            <Items>
                                <ext:FieldContainer ID="FieldContainer6" runat="server" Layout="HBox">
                                    <Items>
                                        <ext:Checkbox ID="ckDelivery" runat="server" MarginSpec="0 4 0 0" Handler="toggleBillingAddressFields"></ext:Checkbox>
                                        <ext:FieldContainer ID="FieldContainer7" runat="server">
                                            <Items>
                                                <ext:FieldContainer ID="FieldContainer12"
                                                    runat="server"
                                                    AnchorHorizontal="100%"
                                                    Layout="HBoxLayout">
                                                    <Items>
                                                        <ext:TextField ID="txtCustomer_Delivery_Address" runat="server" FieldLabel="Địa chỉ giao nhận" Width="500" Disabled="True" MarginSpec="0 20 0 0" />
                                                        <ext:Hidden runat="server" ID="txtCustomer_Delivery_Contact_ID"></ext:Hidden>
                                                        <ext:TextField runat="server" ID="txtCustomer_Delivery_Contact_Name" FieldLabel="Người nhận" Width="212" MarginSpec="0 5 0 0" ReadOnly="True" FieldCls="readonly" Disabled="True"></ext:TextField>
                                                        <ext:Button runat="server" ID="Button3" ToolTip="Thêm người liên hệ" Text="..." Disabled="True">
                                                            <DirectEvents>
                                                                <Click OnEvent="btnCustomer_Delivery_Click">
                                                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                                                </Click>
                                                            </DirectEvents>
                                                        </ext:Button>
                                                    </Items>
                                                </ext:FieldContainer>
                                                <ext:FieldContainer ID="FieldContainer17"
                                                    runat="server"
                                                    AnchorHorizontal="100%"
                                                    Layout="HBoxLayout">
                                                    <Items>
                                                        <ext:DisplayField runat="server" Width="520"></ext:DisplayField>
                                                        <ext:TextField ID="txtCustomer_Delivery_Contact_Job" runat="server" FieldLabel="Chức vụ" Width="240" MarginSpec="0 20 0 0" ReadOnly="True" FieldCls="readonly" Disabled="True" />
                                                        <ext:TextField ID="txtCustomer_Delivery_Contact_Email" runat="server" FieldLabel="Email" Width="240" ReadOnly="True" FieldCls="readonly" Disabled="True" />
                                                    </Items>
                                                </ext:FieldContainer>
                                                <ext:FieldContainer ID="FieldContainer21"
                                                    runat="server"
                                                    AnchorHorizontal="100%"
                                                    Layout="HBoxLayout">
                                                    <Items>
                                                        <ext:DisplayField runat="server" Width="520"></ext:DisplayField>
                                                        <ext:TextField ID="txtCustomer_Delivery_Contact_Phone" runat="server" FieldLabel="Điện thoại" Width="240" MarginSpec="0 20 0 0" ReadOnly="True" FieldCls="readonly" Disabled="True" />
                                                        <ext:TextField ID="txtCustomer_Delivery_Contact_MobilePhone" runat="server" FieldLabel="Di động" Width="240" ReadOnly="True" FieldCls="readonly" Disabled="True" />
                                                    </Items>
                                                </ext:FieldContainer>
                                            </Items>
                                        </ext:FieldContainer>
                                    </Items>
                                </ext:FieldContainer>
                            </Items>
                        </ext:FieldSet>
                        <ext:FieldSet ID="FieldSet3"
                            runat="server"
                            Title="Thông tin thanh toán"
                            Collapsible="true"
                            DefaultAnchor="100%"
                            PaddingSpec="0 10 0 10"
                            MarginSpec="0 0 0 0">
                            <Items>
                                <ext:FieldContainer ID="FieldContainer9" runat="server" Layout="HBox">
                                    <Items>
                                        <ext:Checkbox ID="ckPayment" runat="server" MarginSpec="0 4 0 0" Handler="toggleBillingAddressFields"></ext:Checkbox>
                                        <ext:FieldContainer ID="FieldContainer16" runat="server">
                                            <Items>
                                                <ext:FieldContainer ID="FieldContainer13"
                                                    runat="server"
                                                    AnchorHorizontal="100%"
                                                    Layout="HBoxLayout">
                                                    <Items>
                                                        <ext:TextField ID="txtCustomer_Payment_Address" runat="server" FieldLabel="Địa chỉ thanh toán" Width="500" Disabled="True" MarginSpec="0 20 0 0" />
                                                        <ext:Hidden runat="server" ID="txtCustomer_Payment_Contact_ID"></ext:Hidden>
                                                        <ext:TextField runat="server" ID="txtCustomer_Payment_Contact_Name" FieldLabel="Người thanh toán" Width="212" MarginSpec="0 5 0 0" ReadOnly="True" FieldCls="readonly" Disabled="True"></ext:TextField>
                                                        <ext:Button runat="server" ID="Button5" ToolTip="Thêm người liên hệ" Text="..." Disabled="True">
                                                            <DirectEvents>
                                                                <Click OnEvent="btnCustomer_Payment_Click">
                                                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                                                </Click>
                                                            </DirectEvents>
                                                        </ext:Button>
                                                    </Items>
                                                </ext:FieldContainer>
                                                <ext:FieldContainer ID="FieldContainer18"
                                                    runat="server"
                                                    AnchorHorizontal="100%"
                                                    Layout="HBoxLayout">
                                                    <Items>
                                                        <ext:FieldContainer runat="server" MarginSpec="0 20 0 0">
                                                            <Items>
                                                                <ext:TextArea ID="txtCustomer_Note" runat="server" FieldLabel="Ghi chú" Width="500" Disabled="True" />
                                                            </Items>
                                                        </ext:FieldContainer>
                                                        <ext:FieldContainer ID="FieldContainer19" runat="server">
                                                            <Items>
                                                                <ext:FieldContainer runat="server" Layout="HBox">
                                                                    <Items>
                                                                        <ext:TextField ID="txtCustomer_Payment_Contact_Job" runat="server" FieldLabel="Chức vụ" Width="240" Margins="0 20 0 0" ReadOnly="True" FieldCls="readonly" Disabled="True" />
                                                                        <ext:TextField ID="txtCustomer_Payment_Contact_Email" runat="server" FieldLabel="Email" Width="240" ReadOnly="True" FieldCls="readonly" Disabled="True" />
                                                                    </Items>
                                                                </ext:FieldContainer>
                                                                <ext:FieldContainer ID="FieldContainer20" runat="server" Layout="HBox">
                                                                    <Items>
                                                                        <ext:TextField ID="txtCustomer_Payment_Contact_Phone" runat="server" FieldLabel="Điện thoại" Width="240" Margins="0 20 0 0" ReadOnly="True" FieldCls="readonly" Disabled="True" />
                                                                        <ext:TextField ID="txtCustomer_Payment_Contact_MobilePhone" runat="server" FieldLabel="Di động" Width="240" ReadOnly="True" FieldCls="readonly" Disabled="True" />
                                                                    </Items>
                                                                </ext:FieldContainer>
                                                            </Items>
                                                        </ext:FieldContainer>
                                                    </Items>
                                                </ext:FieldContainer>
                                            </Items>
                                        </ext:FieldContainer>
                                    </Items>
                                </ext:FieldContainer>
                            </Items>
                        </ext:FieldSet>
                    </Items>
                </ext:FormPanel>
            </Items>
        </ext:Window>
        <ext:Menu runat="server" ID="cbCustomer_TypeContext">
            <Items>
                <ext:Button ID="Button2" runat="server" Text="Tải lại" Icon="DatabaseRefresh" Flat="True">
                    <Listeners>
                        <Click Handler="#{cbCustomer_Type}.clearValue(); #{Customer_TypeStore}.reload(); #{cbCustomer_TypeContext}.hide();"></Click>
                    </Listeners>
                </ext:Button>
            </Items>
        </ext:Menu>
        <ext:Menu runat="server" ID="cbEnterpriseContext">
            <Items>
                <ext:Button ID="Button4" runat="server" Text="Tải lại" Icon="DatabaseRefresh" Flat="True">
                    <Listeners>
                        <Click Handler="#{cbEnterprise}.clearValue(); #{EnterpriseStore}.reload(); #{cbEnterpriseContext}.hide();"></Click>
                    </Listeners>
                </ext:Button>
            </Items>
        </ext:Menu>
        <ext:Menu runat="server" ID="cbProvinceContext">
            <Items>
                <ext:Button ID="Button8" runat="server" Text="Tải lại" Icon="DatabaseRefresh" Flat="True">
                    <Listeners>
                        <Click Handler="#{cbProvince}.clearValue(); #{cbProvince1}.clearValue(); #{cbDistricts1}.clearValue(); #{ProvinceStore}.reload(); #{cbDistricts}.setReadOnly(true); #{cbDistricts}.clearValue(); #{cbProvinceContext}.hide();"></Click>
                    </Listeners>
                </ext:Button>
            </Items>
        </ext:Menu>
        <ext:Menu runat="server" ID="cbDistrictsContext">
            <Items>
                <ext:Button ID="Button6" runat="server" Text="Tải lại" Icon="DatabaseRefresh" Flat="True">
                    <Listeners>
                        <Click Handler="#{cbDistricts}.clearValue(); #{cbDistricts1}.clearValue(); #{DistrictsStore}.reload(); #{cbDistrictsContext}.hide();"></Click>
                    </Listeners>
                </ext:Button>
            </Items>
        </ext:Menu>
        <ext:Menu runat="server" ID="cbSectorContext">
            <Items>
                <ext:Button ID="Button10" runat="server" Text="Tải lại" Icon="DatabaseRefresh" Flat="True">
                    <Listeners>
                        <Click Handler="#{cbSector}.clearValue(); #{SectorStore}.reload(); #{cbSectorContext}.hide();"></Click>
                    </Listeners>
                </ext:Button>
            </Items>
        </ext:Menu>
        <ext:Menu runat="server" ID="cbCustomer_ContactContext">
            <Items>
                <ext:Button ID="Button12" runat="server" Text="Tải lại" Icon="DatabaseRefresh" Flat="True">
                    <Listeners>
                        <Click Handler="#{cbCustomer_Contact}.clearValue(); #{Customer_ContactStore}.reload(); #{cbCustomer_ContactContext}.hide();"></Click>
                    </Listeners>
                </ext:Button>
            </Items>
        </ext:Menu>
        <ext:Menu runat="server" ID="cbBankContext">
            <Items>
                <ext:Button ID="Button14" runat="server" Text="Tải lại" Icon="DatabaseRefresh" Flat="True">
                    <Listeners>
                        <Click Handler="#{cbBank}.clearValue(); #{BankStore}.reload(); #{cbBankContext}.hide();"></Click>
                    </Listeners>
                </ext:Button>
            </Items>
        </ext:Menu>
        <ext:Menu runat="server" ID="cbProvince1Context">
            <Items>
                <ext:Button ID="Button16" runat="server" Text="Tải lại" Icon="DatabaseRefresh" Flat="True">
                    <Listeners>
                        <Click Handler="#{cbProvince1}.clearValue(); #{ProvinceStore}.reload(); #{cbProvince1Context}.hide();"></Click>
                    </Listeners>
                </ext:Button>
            </Items>
        </ext:Menu>
        <ext:Menu runat="server" ID="cbDistricts1Context">
            <Items>
                <ext:Button ID="Button18" runat="server" Text="Tải lại" Icon="DatabaseRefresh" Flat="True">
                    <Listeners>
                        <Click Handler="#{cbDistricts1}.clearValue(); #{Districts1Store}.reload(); #{cbDistricts1Context}.hide();"></Click>
                    </Listeners>
                </ext:Button>
            </Items>
        </ext:Menu>
        <ext:Menu runat="server" ID="cbCustomer_Contract_ContactContext">
            <Items>
                <ext:Button ID="Button20" runat="server" Text="Tải lại" Icon="DatabaseRefresh" Flat="True">
                    <Listeners>
                        <Click Handler="#{cbCustomer_Contract_Contact}.clearValue(); #{Customer_ContactStore}.reload(); #{cbCustomer_Contract_ContactContext}.hide();"></Click>
                    </Listeners>
                </ext:Button>
            </Items>
        </ext:Menu>
        <ext:Menu runat="server" ID="cbCustomer_Delivery_ContactContext">
            <Items>
                <ext:Button ID="Button22" runat="server" Text="Tải lại" Icon="DatabaseRefresh" Flat="True">
                    <Listeners>
                        <Click Handler="#{cbCustomer_Delivery_Contact}.clearValue(); #{Customer_ContactStore}.reload(); #{cbCustomer_Delivery_ContactContext}.hide();"></Click>
                    </Listeners>
                </ext:Button>
            </Items>
        </ext:Menu>
        <ext:Menu runat="server" ID="cbCustomer_Payment_ContactContext">
            <Items>
                <ext:Button ID="Button24" runat="server" Text="Tải lại" Icon="DatabaseRefresh" Flat="True">
                    <Listeners>
                        <Click Handler="#{cbCustomer_Payment_Contact}.clearValue(); #{Customer_ContactStore}.reload(); #{cbCustomer_Payment_ContactContext}.hide();"></Click>
                    </Listeners>
                </ext:Button>
            </Items>
        </ext:Menu>
        <%--------------Contact-----------------%>
        <ext:Window ID="WindowCustomerContact" runat="server"
            Title="Thông tin người liên hệ"
            DefaultAnchor="100%"
            Width="829"
            Height="400"
            Hidden="true"
            AutoScroll="false"
            Maximizable="False"
            Minimizable="False"
            AutoDataBind="true"
            Region="Center"
            Resizable="False"
            Modal="true"
            Layout="Fit"
            HideMode="Offsets">
            <Content>
                <ext:GridPanel
                    ID="grCustomerContact"
                    Border="True"
                    runat="server"
                    AutoWidth="true"
                    AutoScroll="true"
                    Cls="gird"
                    EnableColumnMove="true">
                    <Store>
                        <%--------------StoreCustomerContact-----------------%>
                        <ext:Store
                            ID="StoreCustomerContact"
                            runat="server"
                            OnReadData="StoreCustomerContact_RefreshData"
                            PageSize="10">
                            <Model>
                                <ext:Model ID="Model1" runat="server" IDProperty="Contact_ID">
                                    <Fields>
                                        <ext:ModelField Name="Contact_Alias" Type="String" />
                                        <ext:ModelField Name="Contact_Name" Type="String" />
                                        <ext:ModelField Name="Contact_BirthDay" Type="Date" />
                                        <ext:ModelField Name="Contact_Gender" Type="String" />
                                        <ext:ModelField Name="Contact_Phone" Type="String" />
                                        <ext:ModelField Name="Contact_MobilePhone" Type="String" />
                                        <ext:ModelField Name="Contact_Email" Type="String" />
                                        <ext:ModelField Name="Contact_Address" Type="String" />
                                        <ext:ModelField Name="Contact_Note" Type="String" />
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <ColumnModel runat="server">
                        <Columns>
                            <ext:RowNumbererColumn ID="RowNumbererColumn3" runat="server" Width="30" Align="Center" />
                            <ext:Column ID="Column19" runat="server" Text="Mã người liên hệ" Width="100" DataIndex="Contact_Alias"></ext:Column>
                            <ext:Column ID="Column20" runat="server" Text="Tên người liên hệ" Width="150" DataIndex="Contact_Name"></ext:Column>
                            <ext:DateColumn ID="DateColumn2" runat="server" Text="Ngày sinh" Width="100" DataIndex="Contact_BirthDay" Format="dd-MM-yyyy" Align="Center"></ext:DateColumn>
                            <ext:Column ID="Column21" runat="server" Text="Giới tính" Width="50" DataIndex="Contact_Gender"></ext:Column>
                            <ext:Column ID="Column22" runat="server" Text="Điện thoại" Width="90" DataIndex="Contact_Phone"></ext:Column>
                            <ext:Column ID="Column23" runat="server" Text="Di động" Width="90" DataIndex="Contact_MobilePhone"></ext:Column>
                            <ext:Column ID="Column24" runat="server" Text="Email" Width="100" DataIndex="Contact_Email"></ext:Column>
                            <ext:Column ID="Column25" runat="server" Text="Địa chỉ" Width="100" DataIndex="Contact_Address"></ext:Column>
                            <ext:Column ID="Column26" runat="server" Text="Ghi chú" Width="100" DataIndex="Contact_Note" Flex="1"></ext:Column>
                        </Columns>
                    </ColumnModel>
                    <SelectionModel>
                        <ext:CellSelectionModel ID="CellSelectionModel1" runat="server">
                            <DirectEvents>
                                <Select OnEvent="CellCustomerContact_Click">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                </Select>
                            </DirectEvents>
                        </ext:CellSelectionModel>
                    </SelectionModel>
                    <DockedItems>
                        <ext:Toolbar ID="ToolBar1" runat="server" Dock="Bottom" AnchorHorizontal="100%">
                            <Items>
                                <ext:TriggerField ID="txtSearchCustomerContact" runat="server" Width="200" EnableKeyEvents="true" MarginSpec="0 8 0 0">
                                    <Triggers>
                                        <ext:FieldTrigger Icon="Search" />
                                    </Triggers>
                                    <DirectEvents>
                                        <TriggerClick OnEvent="SearchCustomerContact_Event"></TriggerClick>
                                        <KeyPress OnEvent="SearchCustomerContact_Event"></KeyPress>
                                        <KeyUp OnEvent="SearchCustomerContact_Event"></KeyUp>
                                    </DirectEvents>
                                </ext:TriggerField>
                                <ext:PagingToolbar ID="PagingToolbar1" runat="server" StoreID="StoreCustomerContact" BeforePageText="Trang" AfterPageText="của {0}" LastText="Cuối" NextText="Kế tiếp" PrevText="Trở lại" FirstText="Đầu" RefreshText="Làm tươi" DisplayInfo="true" DisplayMsg="Trang {0} - {1} của {2}" />
                            </Items>
                        </ext:Toolbar>
                    </DockedItems>
                </ext:GridPanel>
            </Content>
        </ext:Window>
        <ext:Window ID="WindowCustomerContract" runat="server"
            Title="Thông tin người giao nhận"
            DefaultAnchor="100%"
            Width="829"
            Height="400"
            Hidden="true"
            AutoScroll="false"
            Maximizable="False"
            Minimizable="False"
            AutoDataBind="true"
            Region="Center"
            Resizable="False"
            Modal="true"
            Layout="Fit"
            HideMode="Offsets">
            <Content>
                <ext:GridPanel
                    ID="grCustomerContract"
                    Border="True"
                    runat="server"
                    AutoWidth="true"
                    AutoScroll="true"
                    Cls="gird"
                    EnableColumnMove="true">
                    <Store>
                        <%--------------StoreCustomerContract-----------------%>
                        <ext:Store
                            ID="StoreCustomerContract"
                            runat="server"
                            OnReadData="StoreCustomerContract_RefreshData"
                            PageSize="10">
                            <Model>
                                <ext:Model ID="ModelContract" runat="server" IDProperty="Contact_ID">
                                    <Fields>
                                        <ext:ModelField Name="Contact_Alias" Type="String" />
                                        <ext:ModelField Name="Contact_Name" Type="String" />
                                        <ext:ModelField Name="Contact_BirthDay" Type="Date" />
                                        <ext:ModelField Name="Contact_Gender" Type="String" />
                                        <ext:ModelField Name="Contact_Phone" Type="String" />
                                        <ext:ModelField Name="Contact_MobilePhone" Type="String" />
                                        <ext:ModelField Name="Contact_Email" Type="String" />
                                        <ext:ModelField Name="Contact_Address" Type="String" />
                                        <ext:ModelField Name="Contact_Note" Type="String" />
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <ColumnModel runat="server">
                        <Columns>
                            <ext:RowNumbererColumn ID="RowNumbererColumn2" runat="server" Width="30" Align="Center" />
                            <ext:Column ID="Column1" runat="server" Text="Mã người liên hệ" Width="100" DataIndex="Contact_Alias"></ext:Column>
                            <ext:Column ID="Column12" runat="server" Text="Tên người liên hệ" Width="150" DataIndex="Contact_Name"></ext:Column>
                            <ext:DateColumn ID="DateColumn1" runat="server" Text="Ngày sinh" Width="100" DataIndex="Contact_BirthDay" Format="dd-MM-yyyy" Align="Center"></ext:DateColumn>
                            <ext:Column ID="Column13" runat="server" Text="Giới tính" Width="50" DataIndex="Contact_Gender"></ext:Column>
                            <ext:Column ID="Column14" runat="server" Text="Điện thoại" Width="90" DataIndex="Contact_Phone"></ext:Column>
                            <ext:Column ID="Column15" runat="server" Text="Di động" Width="90" DataIndex="Contact_MobilePhone"></ext:Column>
                            <ext:Column ID="Column16" runat="server" Text="Email" Width="100" DataIndex="Contact_Email"></ext:Column>
                            <ext:Column ID="Column17" runat="server" Text="Địa chỉ" Width="100" DataIndex="Contact_Address"></ext:Column>
                            <ext:Column ID="Column18" runat="server" Text="Ghi chú" Width="100" DataIndex="Contact_Note" Flex="1"></ext:Column>
                        </Columns>
                    </ColumnModel>
                    <SelectionModel>
                        <ext:CellSelectionModel ID="RowSelectionModel2" runat="server">
                            <DirectEvents>
                                <Select OnEvent="CellCustomerContract_Click">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                </Select>
                            </DirectEvents>
                        </ext:CellSelectionModel>
                    </SelectionModel>
                    <DockedItems>
                        <ext:Toolbar ID="ToolBarCustomerContract" runat="server" Dock="Bottom" AnchorHorizontal="100%">
                            <Items>
                                <ext:TriggerField ID="txtSearchCustomerContract" runat="server" Width="200" EnableKeyEvents="true" MarginSpec="0 8 0 0">
                                    <Triggers>
                                        <ext:FieldTrigger Icon="Search" />
                                    </Triggers>
                                    <DirectEvents>
                                        <TriggerClick OnEvent="SearchCustomerContract_Event"></TriggerClick>
                                        <KeyPress OnEvent="SearchCustomerContract_Event"></KeyPress>
                                        <KeyUp OnEvent="SearchCustomerContract_Event"></KeyUp>
                                    </DirectEvents>
                                </ext:TriggerField>
                                <ext:PagingToolbar ID="PagingToolbarCustomerContract" runat="server" StoreID="StoreCustomerContract" BeforePageText="Trang" AfterPageText="của {0}" LastText="Cuối" NextText="Kế tiếp" PrevText="Trở lại" FirstText="Đầu" RefreshText="Làm tươi" DisplayInfo="true" DisplayMsg="Trang {0} - {1} của {2}" />
                            </Items>
                        </ext:Toolbar>
                    </DockedItems>
                </ext:GridPanel>
            </Content>
        </ext:Window>
        <ext:Window ID="WindowCustomerDelivery" runat="server"
            Title="Thông tin người giao nhận"
            DefaultAnchor="100%"
            Width="829"
            Height="400"
            Hidden="true"
            AutoScroll="false"
            Maximizable="False"
            Minimizable="False"
            AutoDataBind="true"
            Region="Center"
            Resizable="False"
            Modal="true"
            Layout="Fit"
            HideMode="Offsets">
            <Content>
                <ext:GridPanel
                    ID="grCustomerDelivery"
                    Border="True"
                    runat="server"
                    AutoWidth="true"
                    AutoScroll="true"
                    Cls="gird"
                    EnableColumnMove="true">
                    <Store>
                        <%--------------StoreCustomerContract-----------------%>
                        <ext:Store
                            ID="StoreCustomerDelivery"
                            runat="server"
                            OnReadData="StoreCustomerDelivery_RefreshData"
                            PageSize="10">
                            <Model>
                                <ext:Model ID="Model2" runat="server" IDProperty="Contact_ID">
                                    <Fields>
                                        <ext:ModelField Name="Contact_Alias" Type="String" />
                                        <ext:ModelField Name="Contact_Name" Type="String" />
                                        <ext:ModelField Name="Contact_BirthDay" Type="Date" />
                                        <ext:ModelField Name="Contact_Gender" Type="String" />
                                        <ext:ModelField Name="Contact_Phone" Type="String" />
                                        <ext:ModelField Name="Contact_MobilePhone" Type="String" />
                                        <ext:ModelField Name="Contact_Email" Type="String" />
                                        <ext:ModelField Name="Contact_Address" Type="String" />
                                        <ext:ModelField Name="Contact_Note" Type="String" />
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <ColumnModel runat="server">
                        <Columns>
                            <ext:RowNumbererColumn ID="RowNumbererColumn4" runat="server" Width="30" Align="Center" />
                            <ext:Column ID="Column27" runat="server" Text="Mã người liên hệ" Width="100" DataIndex="Contact_Alias"></ext:Column>
                            <ext:Column ID="Column28" runat="server" Text="Tên người liên hệ" Width="150" DataIndex="Contact_Name"></ext:Column>
                            <ext:DateColumn ID="DateColumn3" runat="server" Text="Ngày sinh" Width="100" DataIndex="Contact_BirthDay" Format="dd-MM-yyyy" Align="Center"></ext:DateColumn>
                            <ext:Column ID="Column29" runat="server" Text="Giới tính" Width="50" DataIndex="Contact_Gender"></ext:Column>
                            <ext:Column ID="Column30" runat="server" Text="Điện thoại" Width="90" DataIndex="Contact_Phone"></ext:Column>
                            <ext:Column ID="Column31" runat="server" Text="Di động" Width="90" DataIndex="Contact_MobilePhone"></ext:Column>
                            <ext:Column ID="Column32" runat="server" Text="Email" Width="100" DataIndex="Contact_Email"></ext:Column>
                            <ext:Column ID="Column33" runat="server" Text="Địa chỉ" Width="100" DataIndex="Contact_Address"></ext:Column>
                            <ext:Column ID="Column34" runat="server" Text="Ghi chú" Width="100" DataIndex="Contact_Note" Flex="1"></ext:Column>
                        </Columns>
                    </ColumnModel>
                    <SelectionModel>
                        <ext:CellSelectionModel ID="CellSelectionModel2" runat="server">
                            <DirectEvents>
                                <Select OnEvent="CellCustomerDelivery_Click">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                </Select>
                            </DirectEvents>
                        </ext:CellSelectionModel>
                    </SelectionModel>
                    <DockedItems>
                        <ext:Toolbar ID="ToolBar2" runat="server" Dock="Bottom" AnchorHorizontal="100%">
                            <Items>
                                <ext:TriggerField ID="txtSearchCustomerDelivery" runat="server" Width="200" EnableKeyEvents="true" MarginSpec="0 8 0 0">
                                    <Triggers>
                                        <ext:FieldTrigger Icon="Search" />
                                    </Triggers>
                                    <DirectEvents>
                                        <TriggerClick OnEvent="SearchCustomerDelivery_Event"></TriggerClick>
                                        <KeyPress OnEvent="SearchCustomerDelivery_Event"></KeyPress>
                                        <KeyUp OnEvent="SearchCustomerDelivery_Event"></KeyUp>
                                    </DirectEvents>
                                </ext:TriggerField>
                                <ext:PagingToolbar ID="PagingToolbar2" runat="server" StoreID="StoreCustomerDelivery" BeforePageText="Trang" AfterPageText="của {0}" LastText="Cuối" NextText="Kế tiếp" PrevText="Trở lại" FirstText="Đầu" RefreshText="Làm tươi" DisplayInfo="true" DisplayMsg="Trang {0} - {1} của {2}" />
                            </Items>
                        </ext:Toolbar>
                    </DockedItems>
                </ext:GridPanel>
            </Content>
        </ext:Window>
        <ext:Window ID="WindowCustomerPayment" runat="server"
            Title="Thông tin người giao nhận"
            DefaultAnchor="100%"
            Width="829"
            Height="400"
            Hidden="true"
            AutoScroll="false"
            Maximizable="False"
            Minimizable="False"
            AutoDataBind="true"
            Region="Center"
            Resizable="False"
            Modal="true"
            Layout="Fit"
            HideMode="Offsets">
            <Content>
                <ext:GridPanel
                    ID="grCustomerPayment"
                    Border="True"
                    runat="server"
                    AutoWidth="true"
                    AutoScroll="true"
                    Cls="gird"
                    EnableColumnMove="true">
                    <Store>
                        <%--------------Store----------------%>
                        <ext:Store
                            ID="StoreCustomerPayment"
                            runat="server"
                            OnReadData="StoreCustomerPayment_RefreshData"
                            PageSize="10">
                            <Model>
                                <ext:Model ID="Model3" runat="server" IDProperty="Contact_ID">
                                    <Fields>
                                        <ext:ModelField Name="Contact_Alias" Type="String" />
                                        <ext:ModelField Name="Contact_Name" Type="String" />
                                        <ext:ModelField Name="Contact_BirthDay" Type="Date" />
                                        <ext:ModelField Name="Contact_Gender" Type="String" />
                                        <ext:ModelField Name="Contact_Phone" Type="String" />
                                        <ext:ModelField Name="Contact_MobilePhone" Type="String" />
                                        <ext:ModelField Name="Contact_Email" Type="String" />
                                        <ext:ModelField Name="Contact_Address" Type="String" />
                                        <ext:ModelField Name="Contact_Note" Type="String" />
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <ColumnModel runat="server">
                        <Columns>
                            <ext:RowNumbererColumn ID="RowNumbererColumn5" runat="server" Width="30" Align="Center" />
                            <ext:Column ID="Column35" runat="server" Text="Mã người liên hệ" Width="100" DataIndex="Contact_Alias"></ext:Column>
                            <ext:Column ID="Column36" runat="server" Text="Tên người liên hệ" Width="150" DataIndex="Contact_Name"></ext:Column>
                            <ext:DateColumn ID="DateColumn4" runat="server" Text="Ngày sinh" Width="100" DataIndex="Contact_BirthDay" Format="dd-MM-yyyy" Align="Center"></ext:DateColumn>
                            <ext:Column ID="Column37" runat="server" Text="Giới tính" Width="50" DataIndex="Contact_Gender"></ext:Column>
                            <ext:Column ID="Column38" runat="server" Text="Điện thoại" Width="90" DataIndex="Contact_Phone"></ext:Column>
                            <ext:Column ID="Column39" runat="server" Text="Di động" Width="90" DataIndex="Contact_MobilePhone"></ext:Column>
                            <ext:Column ID="Column40" runat="server" Text="Email" Width="100" DataIndex="Contact_Email"></ext:Column>
                            <ext:Column ID="Column41" runat="server" Text="Địa chỉ" Width="100" DataIndex="Contact_Address"></ext:Column>
                            <ext:Column ID="Column42" runat="server" Text="Ghi chú" Width="100" DataIndex="Contact_Note" Flex="1"></ext:Column>
                        </Columns>
                    </ColumnModel>
                    <SelectionModel>
                        <ext:CellSelectionModel ID="CellSelectionModel3" runat="server">
                            <DirectEvents>
                                <Select OnEvent="CellCustomerPayment_Click">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                </Select>
                            </DirectEvents>
                        </ext:CellSelectionModel>
                    </SelectionModel>
                    <DockedItems>
                        <ext:Toolbar ID="ToolBar3" runat="server" Dock="Bottom" AnchorHorizontal="100%">
                            <Items>
                                <ext:TriggerField ID="txtSearchCustomerPayment" runat="server" Width="200" EnableKeyEvents="true" MarginSpec="0 8 0 0">
                                    <Triggers>
                                        <ext:FieldTrigger Icon="Search" />
                                    </Triggers>
                                    <DirectEvents>
                                        <TriggerClick OnEvent="SearchCustomerPayment_Event"></TriggerClick>
                                        <KeyPress OnEvent="SearchCustomerPayment_Event"></KeyPress>
                                        <KeyUp OnEvent="SearchCustomerPayment_Event"></KeyUp>
                                    </DirectEvents>
                                </ext:TriggerField>
                                <ext:PagingToolbar ID="PagingToolbar3" runat="server" StoreID="StoreCustomerPayment" BeforePageText="Trang" AfterPageText="của {0}" LastText="Cuối" NextText="Kế tiếp" PrevText="Trở lại" FirstText="Đầu" RefreshText="Làm tươi" DisplayInfo="true" DisplayMsg="Trang {0} - {1} của {2}" />
                            </Items>
                        </ext:Toolbar>
                    </DockedItems>
                </ext:GridPanel>
            </Content>
        </ext:Window>
    </Content>
</ext:Panel>